package com.nervenets.web.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * Created by Joe on 2018/1/6.
 */
@Component
public class MessageProducer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void sendEmail(EmailMessage message) {
        rabbitTemplate.convertAndSend("emails", message);
    }

    public void flow(FlowMessage message) {
        rabbitTemplate.convertAndSend("flows", message);
    }

    public void push(PushMessage message) {
        rabbitTemplate.convertAndSend("flows", message);
    }
}
